<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core">

    <p:dialog header="Adauga/Editeaza grup" widgetVar="add_group_WV" dynamic="true" minHeight="300" width="600"
              modal="true">

        <h:form id="create_group_form">
            <h:panelGrid columns="2" columnClasses="column-1" styleClass="form-elements">
                <p:outputLabel for="group_name" value="Nume:"/>
                <p:inputText id="group_name" value="#{groupAdministrationBean.selectedUserGroup.name}"/>

                <p:outputLabel for="group_description" value="Descriere:"/>
                <p:inputTextarea id="group_description" value="#{groupAdministrationBean.selectedUserGroup.description}"/>

                <p:outputLabel for="roles" value="Roluri:"/>
                <p:selectManyCheckbox id="roles" value="#{groupAdministrationBean.selectedUserGroup.rolesType}" layout="grid" columns="2">
                    <f:selectItems var="r" value="#{groupAdministrationBean.roles}" itemLabel="#{r.label}" itemValue="#{r}"/>
                </p:selectManyCheckbox>
            </h:panelGrid>

            <p:outputPanel layout="block" style="border-top: 1px solid #A8A8A8; padding: 5px;">
            <p:commandButton icon="ui-icon-disk" value="Salveaza" update="@form :groups_content:groups_list_form"
                             actionListener="#{groupAdministrationBean.saveGroup}"
                             oncomplete="if (args &amp;&amp; !args.validationFailed) add_group_WV.hide()"/>
            <p:commandButton value="Renunta" onclick="PF('add_group_WV').hide();" process="@none"/>
            </p:outputPanel>
        </h:form>
    </p:dialog>


</ui:composition>
